/**
 * 
 */
package com.cqan.utils;

import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

import org.apache.commons.lang.StringUtils;

/**
 * 常用检查工具
 * @author wuhui
 *
 * 上午08:44:52
 */
public class CheckUtils {

	/**
	 * 检查是否为NULL
	 * @param obj
	 * @return
	 */
	public static Boolean isNull(Object obj){
		
		return obj==null;
	}
	
	/**
	 * 检查字符串是否为null或空串
	 * @param value
	 * @return
	 */
	public static Boolean isEmpty(String value){
		 if (value==null) {
			return true;
		}
		return "".equals(StringUtils.trim(value));
	}
	
	public static List<Long> stringParse(String ids){
		List<Long> list = new ArrayList<Long>();
		StringTokenizer st = new StringTokenizer(ids,"-");
		while (st.hasMoreTokens()) {
			String id = st.nextToken();
			if (id!=null&&!"".equals(id)) {
				list.add(Long.parseLong(id));
			}
		}
		return list;
	}
	
	
}
